import {useFloating} from '@floating-ui/react-dom';
import React, { useState } from 'react'; 
export default function App() {
  const {x, y, reference, floating, strategy} = useFloating();
 
  return (
    <>
      <button ref={reference}>Button</button>
      <div
        ref={floating}
        style={{
          position: strategy,
          top: y ?? '',
          left: x ?? '',
        }}
      >
        Tooltip
      </div>
    </>
  );
}